import request from '@/utils/request'

// 查询工程管理列表
export function listProject(query) {
  return request({
    url: '/project/project/list',
    method: 'get',
    params: query
  })
}

// 查询工程管理详细
export function getProject(taskId) {
  return request({
    url: '/project/project/' + taskId,
    method: 'get'
  })
}

// 新增工程管理
export function addProject(data) {
  return request({
    url: '/project/project',
    method: 'post',
    data: data
  })
}

// 修改工程管理
export function updateProject(data) {
  return request({
    url: '/project/project',
    method: 'put',
    data: data
  })
}

// 删除工程管理
export function delProject(taskId) {
  return request({
    url: '/project/project/' + taskId,
    method: 'delete'
  })
}

// 导出工程管理
export function exportProject(query) {
  return request({
    url: '/project/project/export',
    method: 'get',
    params: query
  })
}

// 查询工程管理详细
export function getDistinctSystem(value) {
  return request({
    url: '/project/project/getDistinctSystem/'+value,
    method: 'get'
  })
}

export function getDistinctSubSystem(query) {
  return request({
    url: '/project/project/getDistinctSubSystem',
    method: 'get',
    params: query
  })
}

export function getDistinctDept() {
  return request({
    url: '/project/project/getDistinctDept',
    method: 'get'
  })
}

export function getDistinctTask(query) {
  return request({
    url: '/project/project/getDistinctTask/'+query.planId,
    method: 'get',
    params: query
  })
}

export function importTemplate(value) {
  return request({
    url: '/project/project/importTemplate/',
    method: 'get',
  })
}

export function getGanttData(planId) {
  return request({
    url: '/project/project/gantt/' + planId,
    method: 'get',
  })
}